home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / RTX2000.ZIP / rtx2000 / monitor / io < prev    next >
Encoding:
Text File  |  1992-12-03  |  1.2 KB  |  44 lines

  1. ( *************************** MODULE IO *********************************
  2.    io routines for monitor
  3.  
  4.    Write IO routines specific to your hardware.
  5.    The monitor has been used with serial RS-232 io routines and
  6.    using an IBM-PC or AMIGA as the host.  This allows the user to
  7.    use a terminal emulation program to communicate with the target and
  8.    download software generated from the fc compiler.
  9.  
  10. )
  11.  
  12. : init_io ( -- )
  13. ( Initialize io system )
  14. ( Replace this code with system specific code for your target )
  15.    1 upr!              ( point page register to actel )
  16.    0xC000 ubr!         ( point base register to actel )
  17.    0x1000 0 u!         ( turn on testport )
  18. ;
  19.  
  20.  
  21. : emit     ( u -- ) 
  22. ( Write character u to the output device )
  23. ( Replace this code with system specific code )
  24.      7 of( 2* )
  25.      begin
  26.     0 3 u!        ( reset watchdog timer )
  27.      0x200 0 u@ and  ( wait for transmitter ready )
  28.      until
  29.      1 u!    ( send byte )
  30. ;
  31.     
  32.  
  33. :  key ( -- u )        
  34. ( Wait for input, return input character as u )
  35. ( Replace this code with system specific code )
  36.    begin
  37.       0 3 u!        ( reset watchdog timer )
  38.       0x100 0 u@ and    ( wait for receiver ready )
  39.    until
  40.    1 u@         ( read the char )
  41.    7 of( U2/ )        ( shift it into the low byte )
  42.  
  43.